<% @organization = Organization.find(entity) %>

 <% form_tag :action => 'update_phones', :id => entity do %>
<table class="list">
	<tr>
		<th>Number</th>
		<th>Primary?</th>
		<th>Type</th>
		<th>Carrier</th>
		<th>Comments</th>
		<th>Delete</th>
	</tr>
<% for @phone in @organization.phones %>
   <%= error_messages_for :phone %>
   <% fields_for "phone[]" do |f| %>
<tr class=<%= cycle("even", "odd") %>>
	<td><%= f.text_field :number, :size => 20 %></td>
	<td><%= f.check_box :primary %></td>
	<td><%= f.select( :comm_type_id, CommType.find(:all).collect {|p| [p.name, p.id]}, {}) %></td>
	<td><%= f.select( :sms_setup_id, SmsSetup.find(:all).collect {|p| [p.carrier_name, p.id]}, {}) %></td>
	<td><%= f.text_field :comments, :size => 20 %></td>
	<td><%= link_to "X", :action => 'delete_phone', :id => @phone, :organization => @organization %></td>
</tr>
   <% end %>
 <% end %>
<tr>
	<td><%= submit_tag 'Update' %> | <%= link_to "Cancel", :action => 'show', :id => @organization %></td>
	<td></td>
	<td></td>
	<td></td>
</tr>
</table>
 <% end %>


